package com.ruoyi.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单对象 order
 *
 * @author ruoyi
 * @date 2023-02-20
 */
@Data
public class Order extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 用户名称 */
    @Excel(name = "用户名称")
    private String userName;

    /** 手机号 */
    @Excel(name = "手机号")
    private String userPhone;

    /** 订单号 */
    @Excel(name = "订单号")
    private String orderNo;

    /** 配送地址 */
    @Excel(name = "配送地址")
    private String addr;

    /** 订单状态
  0    生成订单
  1    配送订单
  2    配送完成 */
    @Excel(name = "订单状态")
    private Integer status;

    @Excel(name = "订单状态")
    private String statusDescribe;

    /** 门店id */
    @Excel(name = "门店id")
    private Long shopId;

    /** 门店名称 */
    @Excel(name = "门店名称")
    private String shopName;

    /** 订单描述 */
    @Excel(name = "订单描述")
    private String commodityDescribe;

    private String roles;

    /** 总金额 */
    @Excel(name = "总金额")
    private BigDecimal allMoney;

    /** 到货时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("userName", getUserName())
            .append("userPhone", getUserPhone())
            .append("orderNo", getOrderNo())
            .append("addr", getAddr())
            .append("status", getStatus())
            .append("shopId", getShopId())
            .append("shopName", getShopName())
            .append("createTime", getCreateTime())
            .append("endTime", getEndTime())
            .toString();
    }
}
